約 4,683,233 件
https://w.atwiki.jp/fujiyan/pages/38.html
(作成中) WebコミックLibraryhttp //web-comi.appspot.com/GAE/JとSlim3で作成してみた、各出版社から配信されているWebコミックをまとめて閲覧できるサイトです。只今、実験運用中… 参考サイト 公式サイト Androidで動く携帯Javaアプリ作成入門 Tech Booster 逆引きAndroid入門 ActivityとView 参考 Android Developers 世界を目指せ!Androidアプリ開発入門 Activityは、画面を表す。 ViewはUIを構成する部品。ActivityにViewを設定することで、画面を構築する。 Viewの構成方法は2つ(静的)レイアウトXMLを記述してコンパイルしたものを設定。お手軽。通常はこっち (動的)Viewオブジェクトを適宜生成して設定。前もって作成するViewが決まらない場合はこっち。 XMLでViewを定義 res/layout以下に.xmlファイルを作成 作成すると、R.layout.[ファイル名]という定数名で、作成したViewを表すIDが定義される(ファイル名がmain_layout.xmlなら、R.layout.main_layoutという定数が定義される)。 定義されたIDをActivity#setContentView()に渡す。 複数のView定義が必要な場合は、その分だけxmlファイルを作れば良い。 画面切り替え 参考 アンドロドロ バックボタンで前画面に戻したい場合はActivity切り替えで実装。バックボタンを押すと、アクティブなActivityに対してfinish()が呼び出され、直前のActivityがアクティブになる。ブラウザの「戻る」感覚だろうから、こっちが通常なんでしょう。 グローバルリソース(カメラ等)の取得/解放は、よほどの事情が無い限り、onResume()/onPause()で行うこと。でも、カメラでよくやるような、SurfaceHolderのsurfaceCreated()/surfaceDestroyed()は、Activity切り替え時のタイミングで呼ばれるっぽいので、ここでカメラの取得/解放を行っても大丈夫っぽい(あやふや)。 Activityを2つ用意するのか、1つのActivity内でViewFlipperを使うかは悩み中。多分、メモリ管理を細かく制御して、OSに負担を掛けないようにするのはActivity2つなんでしょう。次画面のActivity起動時に次画面用のリソースを取得、前画面のリソースを解放とか、onStop()/onRestart()でリソースの一時解放/再取得とか。 ViewFlipperの場合は、全ての画面のリソースをまとめてメモリにロードするんじゃないかと。 アプリケーションの終了 単一Activityの場合はfinish()で良い。 複数Activityの場合は、最後に開始したActivityから順次finish()していき、最後にroot Activityをfinish()させるのが良いと思う。これは、Activityはスタックに詰まれていくことに由来。LIFOでfinish()していく。 多分、ActivityからTaskを終了させる方法は無い。何故なら、Activityは、さまざまなTaskから呼ばれることを想定しているため、自分を呼んだTaskを勝手に終了させるわけにはいけないから、かと。 moveTaskToBack()でTaskをバックグラウンドに追いやって、そのうちOSに掃除してもらう、という方法もある。こっちがAndroidの標準だ、という話もあるけど、何となく、うーん。だって、この方法だと、再起動したときに、前の状態から開始されてしまうし…。 moveTaskToBack()はあくまで「中断」であり、「終了」はやっぱり地道にfinish()していくべきだと思うの 一般的な実装としては、startActivityForResult()でchild Activityを開始し、child Activityの終了後に呼ばれるonActivityResult()で、自身もfinish()する System.exit(0)で終わらせてはゼッタイダメ。 カメラ(Android 2.1 API Level 7) AndroidManifest.xmlの記述 参考 プログラマのネタ帳 uses-permission android name="android.permission.CAMERA" / uses-feature android name="android.hardware.camera" / uses-feature android name="android.hardware.camera.autofocus" / uses-feature android name="android.hardware.camera.flash" / uses-permissionで、カメラ利用の許可が必要であることを宣言し、残りの3つでカメラ、オートフォーカス、フラッシュの機能を使用することを宣言します。 また、Activityの属性に下記を追加。 android screenOrientation="landscape" android theme="@android style/Theme.NoTitleBar.Fullscreen" screenOrientationの設定は、なんか、カメラは水平でしか使えないらしいため…。 themeの設定は、アプリをフルスクリーン表示にするため。カメラアプリは基本的にフルスクリーン。 MediaStore.Images.Media.insertImage()で保存すると画質が落ちる 参考 日本Androidの会 画像を加工しない場合は、生成されたjpegデータをそのまま保存する。 // Camera#takePicture()の第3引数に渡す、コールバックオブジェクト private Camera.PictureCallback pictureListener = new Camera.PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { try { insertImageToMediaStore(data); } catch (IOException e) { throw new RuntimeException(e); } //後処理を記述 } }; // dataに格納されたjpegデータを保存 private void insertImageToMediaStore(byte[] data) throws IOException { ContentResolver resolver = getContentResolver(); ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); values.put(MediaStore.Images.Media.DATE_TAKEN, System.currentTimeMillis()); Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); ByteArrayInputStream in = new ByteArrayInputStream(data); try { int size; final int BUFFER_SIZE = 8192; byte[] buffer = new byte[BUFFER_SIZE]; BufferedOutputStream out = new BufferedOutputStream(resolver.openOutputStream(uri)); try { while ((size = in.read(buffer, 0, buffer.length)) 0) { out.write(buffer, 0, size); } out.flush(); } finally { out.close(); } } finally { in.close(); } } 画像を加工して保存 参考 Androidのあ~ん rTAKI0329's android ブログ グロブ(OutOfMemoryで落ちる件) なんか、下の方法みたいに、カメラの撮影サイズでBitmapの別インスタンスを生成すると、メモリ不足で落ちるっぽいぞ…。エミュレーション環境では普通に動くけど、実機でカメラ撮影後に突然落ちるような場合は原因の一つとして疑ってみてもいいかも コールバックメソッドに渡されるjpegデータをBitmapに変換して、Canvasで描画をする。その後、Bitmapをjpegで保存する。 jpeg→ビットマップ→jpegの変換を行うので、画質が落ちたり、ファイルサイズが増えたり…。 BitmapFactory.decodeByteArray()で作るBitmapがimmutableなため、copy()でmutableなBitmapを再作成する。API Level 11なら、decodeByteArray()のオプションでmutableなBitmapを直接作れるかも? // Camera#takePicture()の第3引数に渡す、コールバックオブジェクト private Camera.PictureCallback pictureListener = new Camera.PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { Bitmap orgBmp = BitmapFactory.decodeByteArray(data, 0, data.length); Bitmap bmp = orgBmp.copy(Bitmap.Config.ARGB_8888, true); Canvas canvas = new Canvas(bmp); // canvasで描画 try { insertImageToMediaStore(bmp); } catch (IOException e) { throw new RuntimeException(e); } camera.startPreview(); } }; // Bitmapをjpegで保存 private void insertImageToMediaStore(Bitmap bmp) throws IOException { ContentResolver resolver = getContentResolver(); ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); values.put(MediaStore.Images.Media.DATE_TAKEN, System.currentTimeMillis()); Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); BufferedOutputStream out = new BufferedOutputStream(resolver.openOutputStream(uri)); try { bmp.compress(Bitmap.CompressFormat.JPEG, 100, out); out.flush(); } finally { out.close(); } } GPSとジオコーディング(Android 2.1 API Level 7) LocationManagerを取得する。 LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); onLocationChanged()が呼ばれなくなる 参考 A Day In The Life LocationManager#removeUpdates()を呼ばずにActivityを終了させると、次回起動時にonLocationChanged()が呼ばれなくなるらしいです。必ず呼びましょう。 配布と署名 アプリケーションはapkファイルにパッケージングして配布する。 署名付きapkファイルじゃないと、端末にインストールされません。 署名のためのkeytool使用法 参考 Android Developers keyalgで指定するアルゴリズムはDSAとRSAがサポートされているらしい。通常はRSAにしておきましょう。 keysizeについては2048以上を推奨とされています。 validityで指定する有効期限については、10000日以上を推奨されています。 ということで、推奨されるkeytoolのオプションは keytool -genkey -v -keystore [keystoreファイル名] -alias [エイリアス] -keyalg RSA -keysize 2048 -validity 10000 1つのkeystoreに対して、複数の鍵を生成できる。keystoreの中で、鍵を識別するためにエイリアスを用いる。 なので例えば、keystoreファイル名はワークスペース名、エイリアスはプロジェクト名(=アプリケーション名)、みたいな感じにすると良い(あくまで例)。 keytool -genkey -v -keystore workspace.keystore -alias app1 -keyalg RSA -keysize 2048 -validity 10000 keytool -genkey -v -keystore workspace.keystore -alias app2 -keyalg RSA -keysize 2048 -validity 10000 keystoreファイルやパスワードは失くしたり忘れたりしないようにね あれ、keytoolいらなくね?(ADT Plugin for Eclipseがあれば) apkを作成したいアプリのプロジェクトのルートのコンテキストメニューから、[Export...]→[Android]-[Export Android Application]を選択する。 [Project Checks]で、何もエラーが無いことを確認して[Next ] [Keystore selection]では、最初にkeystoreファイルを作る場合は[Create new keystore]を選択[Location]には、keystoreファイルのフルパスを入力失くさないように、ワークスペース内に、keystoreファイル格納用のプロジェクトを作成し、そこに作成すると良いかも。 [Password]と[Confirm]には、keystoreファイルにアクセスするためのパスワードを入力する。 [Key Creation]では、下記を入力[Alias]には鍵のエイリアスを入力。まぁ普通はアプリケーション名 [Password]と[Confirm]には、鍵にアクセスするためのパスワードを入力する。 [Validity]には年を入力するので注意。推奨は25年以上です。 [First and Last Name]から[Country Code (XX)]については、どれか1つにでも入力すればOK。 [Destination and key/certificate checks]では、下記を入力[Destination APK file]に、出力するapkファイルをフルパスで入力。 あらまぁ簡単
https://w.atwiki.jp/futoyama/pages/108.html
Android機をTCPでPCと接続する 中華PAD(Ainol NOVO ELF2)をLinuxからデバッグするため、TCP/IPで接続した。 Linux(Ubuntu12.04)側にはAndroid SDKがインストール済みで、中華PADはandroid4.0.3。 1.中華PAD側 端末エミュレータを起動し、rootになって以下を実行する。 これでadbがTCPの5555番ポートでlistenする。通常は5555番ポートを使うが、他で使っている場合は別の番号でもよい。 # setprop service.adb.tcp.port 5555 # stop adbd # start adbd 入力が面倒なので、「GScript Lite」に上記を書いたスクリプトを登録して使っている。 また、TCPでの接続とUSBでの接続は排他的なので、USBで接続する場合は以下を実行してTCPでのlistenをやめる必要がある。 # setprop service.adb.tcp.port "" # stop adbd # start adbd 2.Linux側 接続する場合は、Linux側の端末エミュレータから、以下のコマンドを実行する。port番号はデフォルト5555でそれ以外は明示的に指定が必要。 $ adb connect IPアドレス[ port ] $ adb shell -- これでandroid側のコマンドが実行できる。 切断する場合は以下のコマンドを実行する。 $ adb dissconnect --切断
https://w.atwiki.jp/yasrun/pages/60.html
Android 2011年02月23日 00 38 ... Androidはじめました 2011年03月03日 23 05 ... ランダムサークル 2011年03月05日 18 56 ... 線を描く 2011年03月06日 23 31 ... ミニゲーム作り#1 花粉ウォーズ(1) 2011年03月07日 22 36 ... ミニゲーム作り#1 花粉ウォーズ(2) 2011年03月09日 00 21 ... ミニゲーム作り#1 花粉ウォーズ(3) 2011年03月10日 22 29 ... ミニゲーム作り#1 花粉ウォーズ(4)KafunWars.apk GT-P7510でPCに接続してADBでアプリを動かそうとしたら、なんと「USBデバッグモード」のチェックボックスがない!調べたところ、ビルドバージョンを連打するとメニュー項目が追加されるらしい。なんだそりゃ。よくわかってないBlog その2 Nexus7のandroid4.2(Jelly Bean)で、"開発者向けオプション"を表示した http //blog.livedoor.jp/dupondroid/archives/7572456.html .
https://w.atwiki.jp/kimikage/pages/62.html
環境 ■OS Windows XP Home SP3 ■Java JDK Java(TM) 6 Update 26 (バージョン:build 1.6.0_26-b03) ■IDE Eclipse IDE for Java Developers の Windows 32 Bit バージョン(Build id 20110615-0604) ■Android SDK android-sdk_r11-windows.zip ■Eclipse用のAndroidプラグイン(バージョン:11.0.0.v201105251008-128486) Android開発環境構築 コーディング Emulatorの起動 プロジェクトファイルの作成 ボタンを押してメッセージを出してみよう! 画面遷移 画面スクロール 長押し adb デバッグ LogCatの起動
https://w.atwiki.jp/kadenwiki/pages/25.html
TOP スマートフォン android android test
https://w.atwiki.jp/android-reference/pages/22.html
android.app High-level classes encapsulating the overall Android application model. Interfaces DatePickerDialog.OnDateSetListener The callback used to indicate the user is done filling in the date. KeyguardManager.OnKeyguardExitResult Callback passed to exitKeyguardSecurely(KeyguardManager.OnKeyguardExitResult) to notify caller of result. PendingIntent.OnFinished Callback interface for discovering when a send operation has completed. SearchManager.OnCancelListener See setOnCancelListener(SearchManager.OnCancelListener) for configuring your activity to monitor search UI state. SearchManager.OnDismissListener See setOnDismissListener(SearchManager.OnDismissListener) for configuring your activity to monitor search UI state. TimePickerDialog.OnTimeSetListener The callback interface used to indicate the user is done filling in the time (they clicked on the Set button). Classes Activity An activity is a single, focused thing that the user can do. ActivityGroup A screen that contains and runs multiple embedded activities. ActivityManager Interact with the overall activities running in the system. ActivityManager.MemoryInfo Information you can retrieve about the available memory through getMemoryInfo(ActivityManager.MemoryInfo). ActivityManager.ProcessErrorStateInfo Information you can retrieve about any processes that are in an error condition. ActivityManager.RecentTaskInfo Information you can retrieve about tasks that the user has most recently started or visited. ActivityManager.RunningAppProcessInfo Information you can retrieve about a running process. ActivityManager.RunningServiceInfo Information you can retrieve about a particular Service that is currently running in the system. ActivityManager.RunningTaskInfo Information you can retrieve about a particular task that is currently "running" in the system. AlarmManager This class provides access to the system alarm services. AlertDialog A subclass of Dialog that can display one, two or three buttons. AlertDialog.Builder AliasActivity Stub activity that launches another activity (and then finishes itself) based on information in its component s manifest meta-data. Application Base class for those who need to maintain global application state. DatePickerDialog A simple dialog containing an DatePicker. Dialog Base class for Dialogs. ExpandableListActivity An activity that displays an expandable list of items by binding to a data source implementing the ExpandableListAdapter, and exposes event handlers when the user selects an item. Instrumentation Base class for implementing application instrumentation code. Instrumentation.ActivityMonitor Information about a particular kind of Intent that is being monitored. Instrumentation.ActivityResult Description of a Activity execution result to return to the original activity. IntentService An abstract Service that serializes the handling of the Intents passed upon service start and handles them on a handler thread. KeyguardManager Class that can be used to lock and unlock the keyboard. KeyguardManager.KeyguardLock Handle returned by newKeyguardLock(String) that allows you to disable / reenable the keyguard. LauncherActivity Displays a list of all activities which can be performed for a given intent. LauncherActivity.IconResizer Utility class to resize icons to match default icon size. LauncherActivity.ListItem An item in the list ListActivity An activity that displays a list of items by binding to a data source such as an array or Cursor, and exposes event handlers when the user selects an item. LocalActivityManager Helper class for managing multiple running embedded activities in the same process. Notification A class that represents how a persistent notification is to be presented to the user using the NotificationManager. NotificationManager Class to notify the user of events that happen. This is how you tell the user that something has happened in the background. PendingIntent A description of an Intent and target action to perform with it. ProgressDialog A dialog showing a progress indicator and an optional text message or view. SearchManager This class provides access to the system search services. Service A Service is an application component that runs in the background, not interacting with the user, for an indefinite period of time. TabActivity An activity that contains and runs multiple embedded activities or views. TimePickerDialog A dialog that prompts the user for the time of day using a TimePicker. Exceptions PendingIntent.CanceledException Exception thrown when trying to send through a PendingIntent that has been canceled or is otherwise no longer able to execute the request. コメント 名前 コメント すべてのコメントを見る
https://w.atwiki.jp/ivy00/pages/15.html
Android用ページです。 Androidの勉強用のページです。
https://w.atwiki.jp/yk2010/pages/35.html
Android ■ Android 2.x 基本アプリリスト Mobile .
https://w.atwiki.jp/anddoid/pages/35.html
android text 要素 関連タグ 使用例 android text="test" android text="@string/hello_world"
https://w.atwiki.jp/android2chbrowser/pages/30.html
■Tuboroid http //www.narazaki.info/ [Tuboroid] narazaki氏作の多機能2chブラウザ。 かつて人気だったanちゃんなどに変わる2chブラウザとして人気だったが、2009年9月に突如開発中止。 そして2011年1月に突如開発再開(?) 作者曰く、今後は実験的な機能を多数追加していくそうだ。 Tuboroidは2010/09/30を持って開発を終了し、公開を停止しました http //www.narazaki.info/2010/09/tuboroid-8.html 最終バージョン:0.2.2.26.6 2011年1月17日にTuboroid 0.2.2.30.2 (仮)が公開されました。開発再開か… http //www.narazaki.info/2011/01/tuboroid-022302.html 関連スレ 【Android】Tuboroidを語るスレ Part1 http //toki.2ch.net/test/read.cgi/chakumelo/1285827352/l50 【開発】「不当な高評価に耐えられない」Android向け2ちゃんブラウザ「Tuboroid」開発中止(10/09/13) http //hibari.2ch.net/test/read.cgi/pcnews/1284379730/ 関連記事 「不当な高評価に耐えられない」 Android向け2ちゃんブラウザ「Tuboroid」開発中止 http //www.itmedia.co.jp/news/articles/1009/13/news090.html Android向け2chブラウザアプリ「Tuboroid」が9月一杯で配信中止へ。想定外の高評価が理由 http //www.gapsis.jp/2010/09/android2chtuboroid9.html AAも見やすい2ちゃんねる専用ブラウザ「Tuboroid(日本語版)」 http //mobileascii.jp/elem/000/000/010/10560/ Tuboroid / 2ch Viewer見やすさ重視の2ちゃんねるブラウザ! http //androider.jp/?p=1983 ここを編集 最近のリンク元 申し訳ありませんが、recent_page_ref プラグインは提供を終了し、ご利用いただけません。